package com.kbs.pay.management.util;

/**
 * @Author: jianchen
 * @Date: 2019/6/24 9:36
 * @Description: 分页请求类
 */
public class PageRequest {

    //当前页
    private int currentPage;

    //每页条数
    private int pageSize;

    // 当前页起始位置
    private int start;

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    //计算当前页起始位置
    public int getStart() {
        return this.start = (this.currentPage - 1) * this.pageSize >= 0 ? (this.currentPage - 1) * this.pageSize : 0;
    }

    public void setStart(int start) {
        this.start = start;
    }
}
